package com.jspgou.cms.manager;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.jspgou.cms.entity.Cart;
import com.jspgou.cms.entity.Order;
import com.jspgou.cms.entity.Payment;
import com.jspgou.cms.entity.Product;
import com.jspgou.cms.entity.ShopMember;
import com.jspgou.cms.entity.ShopMemberAddress;
import com.jspgou.cms.entity.ShopPaymentorder;
import com.jspgou.common.page.Pagination;

public interface OrderMng {
	
	public Pagination getPage(int pageNo, int pageSize);
	
	public ShopPaymentorder createOrders(Long deliveryMethodSelector[], String ip,String comments,
			Cart cart,Long[] cartItemId,ShopMemberAddress address,Payment pay,ShopMember member, 
			Long webId,String memberCouponId);
	//生成订单
	public Order buyNowCreateOrder(Product product,Integer count,Long deliveryMethodSelector[], String ip,String comments,
			ShopMemberAddress address,Payment pay,ShopMember member, 
			Long webId,String memberCouponId);
	
	/**
	 * 前台店铺退货订单
	 * @param status
	 * @param storeId
	 * @param memberId
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	public Pagination getFcPage(Integer paymentStatus,Integer shippingStatus,Integer status,Long storeId,Long memberId,int pageNo, int pageSize);
	
	public Pagination getPage(Long webId,Long memberId,Long storeId, Integer status,Boolean isRefunded,String code,Long source,
			String productName,String userName,Long paymentId,Long shippingId, 
			Integer paymentStatus,Integer shippingStatus,Long discuss,Date startTime,Date endTime,Double startOrderTotal,
			Double endOrderTotal,int pageNo, int pageSize);
	
	public List<Order> getList(Long webId,Long memberId,Long storeId, Integer status,Integer paymentStatus,
			String productName,String userName,Long paymentId,Long shippingId, 
			Date startTime,Date endTime,Double startOrderTotal,Double endOrderTotal);

	public Order findById(Long id);
	
	public Order findByCode(String code);
	
	public Order findByTradeNo(String tradeNo);

	public Order save(Order bean);
	
	public Order updateByUpdater(Order updater);
	
	public Order deleteById(Long id);

	public Order[] deleteByIds(Long[] ids);
	
	public  List<Object> getTotalOrder();
	
	public List<Object> getStoreTotalOrder(Long id);
	
	public BigDecimal getMemberMoneyByYear(Long memberId);
	
	public Pagination getOrderByReturn(Long memberId,int pageNo,int pageSize);
	//添加方法，根据订单状态获取所有订单
	public List<Order> getCountByStatus(Date startTime,Date endTime,Integer status);
	//根据总订单，查出副订单
	public List<Order> getPaymentOrder(ShopPaymentorder shopPaymentorder);
	
	public List<Order> getStatisticByYear(Integer year,Integer status);
	
	public List<Order> getList1(Long[]memberId);
	
	public List<Order> getlist();
	
	public void abolishOrder();
	
}